package cloud.simple.service.web;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import cloud.simple.service.domain.UserService;
import cloud.simple.service.model.User;

@RestController
public class UserController {

	@Autowired
	UserService userService;
	
	@RequestMapping(value="/user",method=RequestMethod.GET)
	public List<User> readUserInfo(){
//		List<User> ls=userService.searchAll();	
		
		List<User> ls=this.mock();	
		
		return ls;
	}
	
	
	private List<User> mock(){
		
		List<User> list = new ArrayList<User>();
		
		User user = new User();
		user.setUsername("yangcai test");
		
		list.add(user);
		
		return list;
		
	}
	
	
}
